var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, o) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var o in e)
              Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
          })(e, o);
      };
      return function (e, o) {
        function n() {
          this.constructor = e;
        }
        if ("function" != typeof o && null !== o)
          throw new TypeError(
            "Class extends value " + String(o) + " is not a constructor or null"
          );
        t(e, o),
          (e.prototype =
            null === o
              ? Object.create(o)
              : ((n.prototype = o.prototype), new n()));
      };
    })(),
  DropMoneyDetailDialog = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        e.btn_drop_queding.on(Laya.Event.CLICK, e, e.onDropMoneySureAction),
        e.btn_drop_cancle.on(Laya.Event.CLICK, e, e.onDropCancleFn),
        e.btn_drop_item0.on(Laya.Event.CLICK, e, e.onDropItemAction),
        e.btn_drop_item1.on(Laya.Event.CLICK, e, e.onDropItemAction),
        e.btn_drop_item2.on(Laya.Event.CLICK, e, e.onDropItemAction),
        e.btn_drop_item3.on(Laya.Event.CLICK, e, e.onDropItemAction),
        WebSocketService.addListener({
          caller: e,
          code: 1561,
          method: e.onLoadDropMoneyDetailData,
        }),
        e
      );
    }
    return (
      __extends(e, t),
      (e.showDropMoneyDetailView = function (t) {
        null == this.droV && (this.droV = new e()),
          this.droV.popup(!0),
          (this.droV.curTextValue = 500),
          (this.droV.text_dropmoney.text = "500"),
          (this.droV.label_dropDetail_title.text = t),
          "大" == t
            ? (this.droV.type = "2")
            : "小" == t
            ? (this.droV.type = "1")
            : "单" == t
            ? (this.droV.type = "3")
            : "双" == t
            ? (this.droV.type = "4")
            : "豹子" == t && (this.droV.type = "5");
      }),
      (e.prototype.onDropItemAction = function (t) {
        var e = 0;
        this.curTextValue > 0 && (e = this.curTextValue),
          "item0" == t.target.name
            ? (e += 500)
            : "item1" == t.target.name
            ? (e += 1e3)
            : "item2" == t.target.name
            ? (e += 2e3)
            : "item3" == t.target.name && (e += 5e3),
          (this.curTextValue = e),
          (this.text_dropmoney.text = this.curTextValue + "");
      }),
      (e.prototype.onDropMoneySureAction = function () {
        var t = this.text_dropmoney.text;
        parseInt(t) < 500
          ? ToastView.toastView("请输入赌注")
          : WebSocketService.send({
              c: 1561,
              d: { t: this.type, b: parseInt(t) },
            });
      }),
      (e.prototype.onLoadDropMoneyDetailData = function (t) {
        0 == t.code &&
          (this.close(),
          ToastView.toastView("成功下注"),
          WebSocketService.send({ c: 1558, d: null }));
      }),
      (e.prototype.onDropCancleFn = function () {
        this.close();
      }),
      (e.dropClose = function () {
        this.droV && (this.droV.close(), (this.droV = null));
      }),
      e
    );
  })(ui.ChallengeBattle.DropMoneyDetailDialogUI);
